#!/bin/sh

if [ "$1" = "autoconf" ]; then
	echo 'yes'
	exit 0
fi

if [ "$1" = "config" ]; then
	cat <<EOF
graph_title VFS IO Latency
graph_category disk
graph_vlabel operations per \${graph_period}
graph_args --base 1000
graph_info zone vfs io operations per latency bucket
graph_order l10ms l100ms l1s l10s
l10ms.label 10ms
l10ms.type DERIVE
l10ms.min 0
l100ms.label 100ms
l100ms.type DERIVE
l100ms.min 0
l1s.label 1s
l1s.type DERIVE
l1s.min 0
l10s.label 10s
l10s.type DERIVE
l10s.min 0
EOF
	exit 0
fi

kstat -p zone_vfs:*:*:1* | sed 's/.*://;s/_ops//' | awk '{ print "l" $1 ".value", $2 }'
